#include<iostream>
#include<algorithm>
#include<stdio>
using namespace std;

int cycle(int n){
if(n == 1)
return 1;
if(n % 2 == 0)
	return cycle(n / 2) + 1;
return cycle(3 * n+1) + 1;
}

int main(){
	freopen("input.txt", "r+", stdin);
	freopen("output.txt", "w", stdout);
	int m, n;
	while(cin >> m >> n){
		int a = min(m, n);
		int b = max(m,n);
		int maxN = -1;
		int i;
		for(i = a; i <= b; i++){
			int c = cycle(i);
			if(c > maxN)
			maxN = c;	 
		}
		cout << m << ' ' << n << ' ' << maxN << endl;
	}
	return 0;
}

